libxl: generate destructors for each libxl defined type
authorIan Campbell <ian.campbell@citrix.com>
Thu, 19 Aug 2010 14:20:22 +0000 (15:20 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 19 Aug 2010 14:20:22 +0000 (15:20 +0100)
commitbcbf6e2049191fb218ff288106d0744430011dc9
tree71c2df6b88cd195dd16acb201ed854dc9477c252
parent735f084c0f41c313c07bcd345f0abf2850e90c4e
libxl: generate destructors for each libxl defined type

I chose the name "_destroy" rather than "_free" because the destructor
functions will free only the members of a type recursively but will
not free the actual type structure itself. The allocation of the type
is typically done by the caller and may not be a single allocation,
e.g. lists/arrays of types or embedded in other structures etc.

The exceptions to this rule are libxl_string_list_destroy and
libxl_key_value_list_destroy but I'm not 100% convinced they are
exceptions (since they are kind-of opaque) and I couldn't see a
cleanerway to express this concept. I have made a best effort attempt
to implement these functions sanely but since as far as I can tell
nothing in the current code base ever sets
libxl_domain_create_info.{xsdata,platformdata} I'm flying somewhat
blind.

[PATCH 05 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
.hgignore
tools/libxl/Makefile
tools/libxl/gentypes.py
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/libxl.idl
tools/libxl/libxltypes.py